// To parse this JSON data, do
//
//     final realResult = realResultFromJson(jsonString);

import 'dart:convert';

RealResult realResultFromJson(String str) => RealResult.fromJson(json.decode(str));

String realResultToJson(RealResult data) => json.encode(data.toJson());


///实时成绩
class RealResult {
    
    ///头部数据
    Head head;
    
    ///主体数据
    Body body;

    RealResult({
        required this.head,
        required this.body,
    });

    factory RealResult.fromJson(Map<String, dynamic> json) => RealResult(
        head: Head.fromJson(json["Head"]),
        body: Body.fromJson(json["Body"]),
    );

    Map<String, dynamic> toJson() => {
        "Head": head.toJson(),
        "Body": body.toJson(),
    };
}


///主体数据
class Body {
    
    ///代表队/代表团/俱乐部
    String team;
    
    ///运动员姓名
    String athleteName;
    
    ///运动员号码
    String athleteBib;
    
    ///运动员联系方式
    String athleteTelephone;
    
    ///A线成绩
    String resultA;
    
    ///B线成绩
    String resultB;
    
    ///排名
    String rank;

    Body({
        required this.team,
        required this.athleteName,
        required this.athleteBib,
        required this.athleteTelephone,
        required this.resultA,
        required this.resultB,
        required this.rank,
    });

    factory Body.fromJson(Map<String, dynamic> json) => Body(
        team: json["Team"],
        athleteName: json["AthleteName"],
        athleteBib: json["AthleteBib"],
        athleteTelephone: json["AthleteTelephone"],
        resultA: json["ResultA"],
        resultB: json["ResultB"],
        rank: json["Rank"],
    );

    Map<String, dynamic> toJson() => {
        "Team": team,
        "AthleteName": athleteName,
        "AthleteBib": athleteBib,
        "AthleteTelephone": athleteTelephone,
        "ResultA": resultA,
        "ResultB": resultB,
        "Rank": rank,
    };
}


///头部数据
class Head {
    
    ///设备Id
    String deviceId;
    
    ///消息Uuid
    String messageUuid;
    
    ///发送消息的时间。格式：yyyy-MM-dd HH:mm:ss.fff 比如：2020-09-02 12:24:09.923
    String timestamp;
    
    ///消息类型
    String messageType;

    Head({
        required this.deviceId,
        required this.messageUuid,
        required this.timestamp,
        required this.messageType,
    });

    factory Head.fromJson(Map<String, dynamic> json) => Head(
        deviceId: json["DeviceId"],
        messageUuid: json["MessageUuid"],
        timestamp: json["Timestamp"],
        messageType: json["MessageType"],
    );

    Map<String, dynamic> toJson() => {
        "DeviceId": deviceId,
        "MessageUuid": messageUuid,
        "Timestamp": timestamp,
        "MessageType": messageType,
    };
}
